var mongoose = require('mongoose'),
    uuidv4 = require('uuid/v4'),
    Schema = mongoose.Schema;

var sysuserSchema = new Schema({
    _id: String,
    name: String,
    password: String
}, {
        collection: 'sysuser'
    });

// Indexes

// Auto update last update time
sysuserSchema.pre('update', function () {});
sysuserSchema.pre('save', function (next) {
    let sysuser = this;
    sysuser._id = uuidv4();
    next();
});

mongoose.model('Sysuser', sysuserSchema);